Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/deploy: Support locking deployment finalization #1841

Closed
wants to merge 3 commits into from

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Apr 16, 2019

Teach ostree-finalize-staged.service to check for a file in /run to
determine if it should do the finalization. This will be used in
RPM-OSTree, where we want to be able to separate out "preparing updates"
from "making update the default" for more fine-grained control. See:
coreos/rpm-ostree#1748

@jlebon jlebon added the WIP label Apr 16, 2019
@jlebon
Copy link
Member Author

jlebon commented Apr 16, 2019

Ahh, keep forgetting to try out the new GitHub draft PR feature.
Anyway, marking as WIP for now. Still testing this!

@jlebon jlebon changed the title lib/deploy: Support gating deployment finalization WIP: lib/deploy: Support gating deployment finalization Apr 16, 2019
@jlebon jlebon force-pushed the pr/staging-paths branch 2 times, most recently from 5ccec0c to 094ef46 Compare April 17, 2019 02:57
@cgwalters
Copy link
Member

Do we expect rpm-ostree will e.g. always write out this file when it starts?

@jlebon
Copy link
Member Author

jlebon commented Apr 17, 2019

Do we expect rpm-ostree will e.g. always write out this file when it starts?

Yeah, so basically I'm thinking something like:

  • agent calls UpdateDeployment with lock-finalization option on
    • touch /run/ostree/staged-deployment-locked
    • stage deployment
  • at a later time, agent calls UnlockStagedDeployment, which removes the file

@jlebon
Copy link
Member Author

jlebon commented Apr 17, 2019

I guess we could always write out the file on boot... Hmm, this ties into coreos/rpm-ostree#1747 as well. E.g. if we're driven by an agent, then we could default to always locking finalization? Though I think I'd prefer making it explicit still and just let the "driver" part be about automatic updates and injecting info in rpm-ostree status as discussed in that issue.

Rather than wrapping each instance of `sd_journal_*` with
`HAVE_SYSTEMD`, let's just add some convenience macros that are just
no-op if we're not compiling with systemd.
This can happen if a deployment was staged and later cleaned up. Though
just as a helper when debugging issues, let's explicitly mention that
case.
Teach `ostree-finalize-staged.service` to check for a file in `/run` to
determine if it should do the finalization. This will be used in
RPM-OSTree, where we want to be able to separate out "preparing updates"
from "making update the default" for more fine-grained control. See:
coreos/rpm-ostree#1748
@jlebon jlebon changed the title WIP: lib/deploy: Support gating deployment finalization lib/deploy: Support gating deployment finalization Apr 24, 2019
@jlebon jlebon changed the title lib/deploy: Support gating deployment finalization lib/deploy: Support locking deployment finalization Apr 24, 2019
@jlebon
Copy link
Member Author

jlebon commented Apr 24, 2019

OK, this one should be good to go!

@cgwalters
Copy link
Member

@rh-atomic-bot r+ b003fcd

@rh-atomic-bot
Copy link

⌛ Testing commit b003fcd with merge 586cc2d...

rh-atomic-bot pushed a commit that referenced this pull request Apr 24, 2019
This can happen if a deployment was staged and later cleaned up. Though
just as a helper when debugging issues, let's explicitly mention that
case.

Closes: #1841
Approved by: cgwalters
rh-atomic-bot pushed a commit that referenced this pull request Apr 24, 2019
Teach `ostree-finalize-staged.service` to check for a file in `/run` to
determine if it should do the finalization. This will be used in
RPM-OSTree, where we want to be able to separate out "preparing updates"
from "making update the default" for more fine-grained control. See:
coreos/rpm-ostree#1748

Closes: #1841
Approved by: cgwalters
@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: cgwalters
Pushing 586cc2d to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants